{% extends 'base_backend.html' %}
{% load static %}
{% block header_tail %}
    <link rel="stylesheet" href="{% static 'public/CodeMirror/lib/codemirror.css' %}">
    <link rel="stylesheet" href="{% static 'public/ComboSelect/css/combo.select.css' %}">
    <link rel="stylesheet" href="{% static 'public/CodeMirror/theme/lesser-dark.css' %}">
    <link rel="stylesheet" href="{% static 'public/CodeMirror/addon/dialog/dialog.css' %}">
    <link rel="stylesheet" href="{% static 'public/CodeMirror/addon/search/matchesonscrollbar.css' %}">
    <link rel="stylesheet" href="{% static 'plugins/select2/select2.css' %}">
    <link rel="stylesheet" href="{% static 'public/ComboSelect/css/combo.select.css' %}">
    <link rel="stylesheet" href="{% static 'zhongbao/config/css/main.css' %}">
    <script src="{% static 'plugins\jQuery\jquery-2.2.3.min.js' %}"></script>
    <script src="{% static 'plugins/vue1/vue.js' %}"></script>

    <style>
        .login-banner {
            width: 100%;
            background: url("{% static 'public/img/banner2.jpg' %}") center bottom/cover no-repeat;
        }
    </style>
{% endblock header_tail %}

{% block section_content %}
    <div>
        <div class="box-header with-border">
            <h3 class="box-title">{{ model_verbose_name }}</h3>
        </div>
        <!-- form start -->
        <div class="box box-primary">
            <div class="box-body">
                <input class="no-display" type="text">
                <p style="clear: both"></p>
                <div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">任务ID：</label>
                        <p id="taskId" type="text" class="config-input">{{ task.id }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">项目ID：</label>
                        <p type="text" class="config-input">{{ task.project_id }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">网站名称：</label>
                        <p type="text" class="config-input">{{ task.site_name }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">网站URL：</label>
                        <p type="text" class="config-input">{{ task.site_url }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">网站类型：</label>
                        <p type="text" class="config-input">{{ task.site_type }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">域名：</label>
                        <p type="text" class="config-input">{{ task.domain }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">一级域名：</label>
                        <p type="text" class="config-input">{{ task.first_domain }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">分配时间：</label>
                        <p type="text" id="allocation_flag" class="config-input"></p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">通过时间：</label>
                        <p id="finish_flag" type="text" class="config-input"></p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">分配代码：</label>
                        <p type="text" class="config-input">{{ task.process_type }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">任务备注：</label>
                        <p type="text" class="config-input">{{ task.note }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">录入时间：</label>
                        <p type="text" id="ctime" class="config-input"></p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">用户ID：</label>
                        <p type="text" class="config-input">{{ task.uid }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">网站国家：</label>
                        <p type="text" class="config-input">
                            {% if task.country %}
                                {{ task.country }}
                            {% else %}

                            {% endif %}
                        </p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">网站语言：</label>
                        <p type="text" class="config-input">{{ task.lang }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">任务描述：</label>
                        <p type="text" class="config-input">{{ task.description }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">任务状态：</label>
                        {% for filter in filters %}
                            {% if filter.status == task.status.code %}
                                <p type="text" id="status" class="config-input">{{ filter.name }}</p>
                            {% endif %}
                        {% endfor %}
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">ICP：</label>
                        <p type="text" class="config-input">{{ task.icp }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">管控平台任务描述：</label>
                        <p type="text" class="config-input">{{ task.gk_description }}</p>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="id" class="control-label">管控平台任务备注：</label>
                        <p type="text" class="config-input">{{ task.gk_remark }}</p>
                    </div>
                </div>
                <script>
                    var $alloc = $("#allocation_flag");
                    {% if task.allocation_flag == None %}
                        var alloc = null;
                    {% else %}
                        var alloc = {{ task.allocation_flag }};
                    {% endif %}
                    if (alloc) {
                        var newDate = new Date();
                        newDate.setTime(alloc * 1000);
                        $alloc.text(newDate.toLocaleDateString())
                    }

                    var $fin = $("#finish_flag");
                    {% if task.finish_flag == None %}
                        var fin = null;
                    {% else %}
                        var fin = {{ task.finish_flag }};
                    {% endif %}
                    if (fin) {
                        var newDate = new Date();
                        newDate.setTime(fin * 1000);
                        $fin.text(newDate.toLocaleDateString())
                    }

                    var $ct = $("#ctime");
                    {% if task.ctime == None %}
                        var ct = null;
                    {% else %}
                        var ct = {{ task.ctime }};
                    {% endif %}
                    if (ct) {
                        var newDate = new Date();
                        newDate.setTime(ct * 1000);
                        $ct.text(newDate.toLocaleDateString())
                    }
                </script>
                <br style="clear: both">
                <hr style="margin-top: 0">
                <div class="form-group">
                    <div style="float: left;" class="input-group select-config-div">
                        <label for="">配置列表：</label>
                    </div>
                    <div style="float: left;" class="input-group select-config-div">
                        <!--
                            {/% if task.status == 3 or task.status == 6 %}
                                <a href="{/% url 'task:add_config' %}?tid={/{ task.id }}" class="btn btn-info btn-xs" tag="1" id="config-add">添加配置</a>
                            {/% endif %}
                           -->
                    </div>
                    <div style="float: left; color: red;">
                        <span id="message"></span>
                    </div>
                    <span style="color: #00a7d0;margin-left: 10px"></span>
                </div>

                <div class="form-group" id="configList">
                    <table id="config_each_table" border="1" class="table table-bordered table-hover table-striped">
                        <thead>
                        <tr>
                            <th v-for="head in headers">
                                <span style="float: left">
                                    [[ head.name ]]
                                </span>
                            </th>
                            <th>
                                <span style="float: left">
                                    操作
                                </span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <template v-for="config in configs">
                            <!--<tr v-if="task.allocation_flag">-->
                            <tr>
                                <template v-for="head in headers">
                                    <td v-if="head.key == 'allocation_flag' || head.key == 'ctime' || head.key == 'finish_flag'">
                                        [[ parseTime(config[head.key]) ]]
                                    </td>
                                    <td v-else>[[ config[head.key] ]]</td>
                                </template>
                                <!--<td v-for="head in headers">[[ config[head.key] ]]</td>-->
                                <td class="btn-group">
                                    <button v-if="config._status == 3 || config._status == 6" type="button"
                                            value="[[ config.id ]]" class="btn btn-info btn-xs"
                                            onclick="deleteOneConfig([[ config.id ]])">删除
                                    </button>
                                    <button type="button" value="[[ config.id ]]" class="btn btn-info btn-xs"
                                            onclick="detailOneConfig([[ config.id ]])">详情
                                    </button>
                                    {% if user.is_superuser %}
                                        <a href="{% url 'task:data_size' %}?cid=[[config.id]]"
                                           class="btn btn-info btn-xs" target="_blank">采集量统计</a>
                                        <button v-if="config._status == 3 || config._status == 4 || config._status == 11"
                                                type="button" class="btn btn-info btn-xs" data-toggle="modal"
                                                data-target="#[[ config.id ]]_myModal">一键同步
                                        </button>
                                    {% endif %}
                                </td>
                            </tr>
                        </template>
                        </tbody>
                    </table>
                    <template v-for="config in configs">
                        <template v-if="config._status == 3 || config._status == 4 || config._status == 11">
                            <!-- 一键同步 配置信息 模态框（Modal） -->
                            <div class="modal fade" id="[[ config.id ]]_myModal" tabindex="-1" role="dialog"
                                 aria-labelledby="myModalLabel"
                                 aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content box">
                                        <form action="" method="post">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"
                                                        aria-hidden="true">
                                                    &times;
                                                </button>
                                                <h4 class="modal-title" id="myModalLabel">
                                                    请选择配置信息
                                                </h4>
                                            </div>
                                            <div class="modal-body">
                                                <input id='[[ config.id ]]_file_name' type="hidden"
                                                       value="[[ config.savename ]]">
                                                <input id='[[ config.id ]]_webname' type="hidden"
                                                       value="[[ config.webname ]]">
                                                <input id='[[ config.id ]]_domain' type="hidden"
                                                       value="[[ config.url ]]">
                                                <input id='[[ config.id ]]_path' type="hidden"
                                                       value="[[ config.savepath ]]">
                                                <span>配置分组</span>
                                                <select class="config-input select2" name="conf_group"
                                                        id="[[ config.id ]]_conf_group">
                                                    <option value="76">秘书_新闻_15</option>
                                                    <option value="438">招标_众包</option>
                                                    <option value="148">秘书_新闻_1</option>
                                                    <option value="153">秘书_新闻_5</option>
                                                    <option value="215">外文快速</option>
                                                    <option value="106">外文网站</option>
                                                    <option value="439">astrill海外网站</option>
                                                    <option value="61">quixey</option>
                                                    <option value="93">quixey_2016Q2</option>
                                                    <option value="73">quixey_daily</option>
                                                    <option value="133">quixey_model</option>
                                                    <option value="175">quixey_script</option>
                                                    <option value="189">quixey_项目</option>
                                                    <option value="113">Twitter</option>
                                                    <option value="224">twitter添加热搜词</option>
                                                    <option value="216">youtube</option>
                                                    <option value="225">youtube2</option>
                                                    <option value="112">临时测试</option>
                                                    <option value="172">人民网地方领导留言版</option>
                                                    <option value="139">今日头条</option>
                                                    <option value="180">今日头条传播分析</option>
                                                    <option value="202">传媒36kr</option>
                                                    <option value="146">传播分析评论采集</option>
                                                    <option value="204">全字段采集-快速</option>
                                                    <option value="205">全字段采集-普通</option>
                                                    <option value="78">全站爬虫测试组</option>
                                                    <option value="168">凤凰网自增id</option>
                                                    <option value="173">协作模式列表页_1</option>
                                                    <option value="167">协作模式列表页_15</option>
                                                    <option value="166">协作模式列表页_5</option>
                                                    <option value="183">可视化爬虫配置</option>
                                                    <option value="203">商情快速</option>
                                                    <option value="108">国资委政策网站</option>
                                                    <option value="51">国际智库</option>
                                                    <option value="207">图谱</option>
                                                    <option value="222">境外测试</option>
                                                    <option value="221">外文重点</option>
                                                    <option value="186">大型综合网站</option>
                                                    <option value="220">安卓爬虫</option>
                                                    <option value="122">定时任务爬虫机</option>
                                                    <option value="194">实施部</option>
                                                    <option value="171">属地论坛</option>
                                                    <option value="169">已停配置</option>
                                                    <option value="176">异构_金融</option>
                                                    <option value="213">异构数据全字段-快速</option>
                                                    <option value="212">异构数据全字段-慢速</option>
                                                    <option value="211">异构数据全字段-普通</option>
                                                    <option value="217">异构数据列表页_快速</option>
                                                    <option value="218">异构数据列表页_普通</option>
                                                    <option value="214">异构数据新爬虫</option>
                                                    <option value="117">微博关系-探测</option>
                                                    <option value="116">微博关系-管理</option>
                                                    <option value="118">微博关系-采集</option>
                                                    <option value="208">微博重点人</option>
                                                    <option value="110">忠旺SEO搜索配置组</option>
                                                    <option value="198">悟空问答</option>
                                                    <option value="97">招标网站</option>
                                                    <option value="223">招标网站_快速</option>
                                                    <option value="164">搜狐号-探测</option>
                                                    <option value="165">搜狐号-详情页</option>
                                                    <option value="96">政策网站</option>
                                                    <option value="201">文书网</option>
                                                    <option value="91">新闻回复采集</option>
                                                    <option value="206">旅游评论</option>
                                                    <option value="72">智慧商情</option>
                                                    <option value="104">智慧商情_企业公示</option>
                                                    <option value="102">智慧商情_天眼查</option>
                                                    <option value="193">智慧商情_平台数据组</option>
                                                    <option value="100">智慧商情快速</option>
                                                    <option value="111">测试爬虫机</option>
                                                    <option value="45">海外_用户词搜素</option>
                                                    <option value="196">海外境内网站</option>
                                                    <option value="197">海外快速</option>
                                                    <option value="21">海外网站</option>
                                                    <option value="219">海外重点</option>
                                                    <option value="105">海外重点审核网站</option>
                                                    <option value="59">润滑油</option>
                                                    <option value="170">澎湃新闻</option>
                                                    <option value="120">监控服务爬虫机</option>
                                                    <option value="132">知乎</option>
                                                    <option value="181">知乎_测试</option>
                                                    <option value="209">知乎加速</option>
                                                    <option value="182">知乎搜索</option>
                                                    <option value="190">知乎解码</option>
                                                    <option value="71">石嘴山</option>
                                                    <option value="41">秘书_goverment</option>
                                                    <option value="37">秘书_top20_id</option>
                                                    <option value="55">秘书__平面媒体</option>
                                                    <option value="47">秘书_回复</option>
                                                    <option value="27">秘书_用户词搜索</option>
                                                    <option value="123">秘书_用户词搜索_快速</option>
                                                    <option value="130">秘书_行业词搜索_快速</option>
                                                    <option value="94">秘书_视频_1</option>
                                                    <option value="35">秘书_视频_15</option>
                                                    <option value="107">秘书_视频_5</option>
                                                    <option value="19">秘书_论坛_1</option>
                                                    <option value="75">秘书_论坛_15</option>
                                                    <option value="39">秘书_论坛_5</option>
                                                    <option value="42">秘书_长微博</option>
                                                    <option value="199">自媒体采集帐号探测组</option>
                                                    <option value="98">藏维蒙语</option>
                                                    <option value="154">行业_旅游_1</option>
                                                    <option value="84">行业_旅游_15</option>
                                                    <option value="158">行业_旅游_5</option>
                                                    <option value="150">行业_汽车_1</option>
                                                    <option value="86">行业_汽车_15</option>
                                                    <option value="156">行业_汽车_5</option>
                                                    <option value="152">行业_金融_1</option>
                                                    <option value="81">行业_金融_15</option>
                                                    <option value="157">行业_金融_5</option>
                                                    <option value="185">行业_金融_重要</option>
                                                    <option value="149">行业数据_1</option>
                                                    <option value="49">行业数据_15</option>
                                                    <option value="155">行业数据_5</option>
                                                    <option value="87">行业数据_网页搜索</option>
                                                    <option value="192">行业洞察项目_fast</option>
                                                    <option value="195">行业洞察项目_middle</option>
                                                    <option value="191">行业洞察项目_slow</option>
                                                    <option value="114">评论回采</option>
                                                    <option value="17">话题挖掘</option>
                                                    <option value="92">话题挖掘_最新_快速</option>
                                                    <option value="121">话题挖掘快速</option>
                                                    <option value="124">配置组专用-临时采集任务</option>
                                                    <option value="177">采编权网站</option>
                                                    <option value="147">门户网站新闻</option>
                                                    <option value="29">间隔性配置文件</option>
                                                    <option value="119">阅读数评论数点赞数回采</option>
                                                    <option value="200">首页巡查</option>
                                                    <option value="89">首页巡查_停用</option>
                                                    <option value="210">首页巡查_秘书</option>
                                                </select>
                                                <span>数据类型</span>
                                                <select class="config-input select2" name="web_type"
                                                        id="[[ config.id ]]_web_type">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="15">新闻</option>
                                                    <option value="17">论坛</option>
                                                    <option value="19">博客</option>
                                                    <option value="21">微博</option>
                                                    <option value="23">视频</option>
                                                    <option value="25">平面媒体</option>
                                                    <option value="27">行业网站</option>
                                                    <option value="29">微信</option>
                                                    <option value="30">长微博</option>
                                                    <option value="31">APP</option>
                                                    <option value="32">评论</option>
                                                </select>
                                                <span>行业类型</span>
                                                <select class="config-input select2" name="trade_type"
                                                        id="[[ config.id ]]_trade_type">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="5">综合</option>
                                                    <option value="7">招标</option>
                                                    <option value="9">政府</option>
                                                    <option value="11">汽车</option>
                                                    <option value="13">教育</option>
                                                    <option value="15">房产</option>
                                                    <option value="17">金融</option>
                                                    <option value="19">科技</option>
                                                    <option value="21">文体娱乐</option>
                                                    <option value="25">旅游</option>
                                                    <option value="27">饮食</option>
                                                    <option value="29">医疗健康</option>
                                                    <option value="31">时尚购物</option>
                                                    <option value="35">招聘</option>
                                                    <option value="36">外媒</option>
                                                    <option value="37">其他</option>
                                                </select>
                                                <span>主体类型</span>
                                                <select class="config-input" id="id_yqms_main_type_id"
                                                        name="yqms_main_type_id">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="4">政府</option>
                                                    <option value="5">企业</option>
                                                    <option value="6">媒体</option>
                                                    <option value="7">其他</option>
                                                </select>
                                                <span>网站来源</span>
                                                <select class="config-input" id="id_yqms_web_source_id"
                                                        name="yqms_web_source_id">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="8">境内</option>
                                                    <option value="9">境外</option>
                                                    <option value="10">外媒</option>
                                                </select>
                                                <span>标签</span>
                                                <input type="text" class="config-input select2" name="id_tags"
                                                       id="[[ config.id ]]_id_tag" value="[[ config.webname ]]">
                                                <span>入库去重：</span>
                                                <select class="config-input select2" name="uig"
                                                        id="[[ config.id ]]_id_uig">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="2">网络媒体</option>
                                                    <option value="6">行业</option>
                                                    <option value="7">海外</option>
                                                    <option value="8">话题</option>
                                                    <option value="9">属地</option>
                                                    <option value="10">政策法规</option>
                                                    <option value="11">招标</option>
                                                    <option value="12">外文</option>
                                                    <option value="13">漫游搜索</option>
                                                    <option value="14">问答</option>
                                                    <option value="15">百度贴吧</option>
                                                    <option value="16">新浪微博</option>
                                                    <option value="17">腾讯微博</option>
                                                    <option value="18">行业汽车</option>
                                                    <option value="19">行业金融</option>
                                                    <option value="20">行业旅游</option>
                                                    <option value="21">藏维蒙文</option>
                                                    <option value="22">境外本地</option>
                                                    <option value="23">首页巡查_秘书</option>
                                                </select>
                                                <span>是否代理：</span>
                                                <select class="config-input select2" name="is_agent"
                                                        id="[[ config.id ]]_id_is_agent">
                                                    <option value="2">默认</option>
                                                    <option value="0">否</option>
                                                    <option value="1">是</option>
                                                </select>
                                                <span>代理地址：</span>
                                                <select class="config-input select2" name="proxy_addresses_id"
                                                        id="[[ config.id ]]_id_proxy_addresses_id">
                                                    <option value="" selected="selected">---------</option>
                                                    <option value="1">proxy2_all</option>
                                                    <option value="2">proxy</option>
                                                    <option value="3">proxy_100ms</option>
                                                    <option value="5">proxy_500ms</option>
                                                    <option value="6">proxy_ha</option>
                                                    <option value="7">proxy2_ha</option>
                                                    <option value="8">proxy2_oversea</option>
                                                    <option value="9">proxy2_https_oversea</option>
                                                    <option value="10">proxy2_https</option>
                                                    <option value="15">阿里云代理（微博探测用）</option>
                                                    <option value="16">ADSL代理</option>
                                                    <option value="17">芝麻代理</option>
                                                    <option value="19">自建_aws_http</option>
                                                    <option value="20">自建_aws_https</option>
                                                    <option value="21">讯代理https</option>
                                                    <option value="23">蘑菇代理</option>
                                                    <option value="24">自建扫描代理</option>
                                                </select>
                                                <span>数据来源：</span>
                                                <select class="config-input select2" name="datasourcetype"
                                                        id="[[ config.id ]]_id_datasourcetype">
                                                    <option value="" selected="selected">----</option>
                                                    <option value="1">网络媒体</option>
                                                    <option value="2">行业其他</option>
                                                    <option value="3">境外</option>
                                                    <option value="4">地方网站</option>
                                                    <option value="8">搜索引擎</option>
                                                    <option value="9">金融</option>
                                                    <option value="10">汽车</option>
                                                    <option value="11">旅游</option>
                                                    <option value="13">政策法规</option>
                                                    <option value="14">招标</option>
                                                    <option value="15">问答</option>
                                                    <option value="16">藏维蒙文</option>
                                                    <option value="17">外文</option>
                                                    <option value="18">漫游搜索</option>
                                                    <option value="20">图片识别</option>
                                                </select>
                                                <span>国家或地区：</span>
                                                <select class="config-input select2" name="country"
                                                        id="[[ config.id ]]_id_country" tabindex="-1">
                                                    <option value="216">中国</option>
                                                    <option value="24">阿尔巴尼亚</option>
                                                    <option value="1">阿尔及利亚</option>
                                                    <option value="16">阿富汗</option>
                                                    <option value="36">阿根廷</option>
                                                    <option value="159">爱尔兰</option>
                                                    <option value="181">埃及</option>
                                                    <option value="49">埃塞俄比亚</option>
                                                    <option value="95">爱沙尼亚</option>
                                                    <option value="140">阿拉伯联合酋长国</option>
                                                    <option value="184">阿鲁巴</option>
                                                    <option value="19">阿曼</option>
                                                    <option value="168">安道尔</option>
                                                    <option value="106">安哥拉</option>
                                                    <option value="29">安圭拉岛</option>
                                                    <option value="133">安提瓜和巴布达</option>
                                                    <option value="62">澳大利亚</option>
                                                    <option value="41">奥地利</option>
                                                    <option value="7">澳门特别行政区</option>
                                                    <option value="134">阿塞拜疆</option>
                                                    <option value="92">巴巴多斯</option>
                                                    <option value="88">巴布亚新几内亚</option>
                                                    <option value="150">巴哈马</option>
                                                    <option value="153">白俄罗斯</option>
                                                    <option value="102">百慕大群岛</option>
                                                    <option value="39">巴基斯坦</option>
                                                    <option value="78">巴拉圭</option>
                                                    <option value="224">巴勒斯坦</option>
                                                    <option value="144">巴林</option>
                                                    <option value="38">巴拿马</option>
                                                    <option value="107">保加利亚</option>
                                                    <option value="65">巴西</option>
                                                    <option value="129">贝宁</option>
                                                    <option value="64">比利时</option>
                                                    <option value="58">秘鲁</option>
                                                    <option value="185">冰岛</option>
                                                    <option value="219">博茨瓦纳</option>
                                                    <option value="195">波多黎各</option>
                                                    <option value="178">波兰</option>
                                                    <option value="199">玻利维亚</option>
                                                    <option value="34">伯利兹</option>
                                                    <option value="11">波斯尼亚和黑塞哥维那</option>
                                                    <option value="103">不丹</option>
                                                    <option value="196">布基纳法索</option>
                                                    <option value="69">布隆迪</option>
                                                    <option value="170">布韦岛</option>
                                                    <option value="73">朝鲜</option>
                                                    <option value="182">赤道几内亚</option>
                                                    <option value="47">丹麦</option>
                                                    <option value="105">德国</option>
                                                    <option value="91">东帝</option>
                                                    <option value="186">多哥</option>
                                                    <option value="172">多米尼加共和国</option>
                                                    <option value="158">多米尼克</option>
                                                    <option value="156">厄瓜多尔</option>
                                                    <option value="167">俄罗斯</option>
                                                    <option value="111">法国</option>
                                                    <option value="82">梵蒂冈城</option>
                                                    <option value="81">法属波利尼西亚</option>
                                                    <option value="42">法属圭亚那</option>
                                                    <option value="166">法属南极地区</option>
                                                    <option value="46">斐济群岛</option>
                                                    <option value="202">菲律宾</option>
                                                    <option value="118">芬兰</option>
                                                    <option value="37">佛得角</option>
                                                    <option value="108">福克兰群岛(马尔维纳斯群岛)</option>
                                                    <option value="157">冈比亚</option>
                                                    <option value="162">刚果共和国</option>
                                                    <option value="45">格陵兰</option>
                                                    <option value="32">格林纳达</option>
                                                    <option value="120">格鲁吉亚</option>
                                                    <option value="3">哥伦比亚</option>
                                                    <option value="220">哥斯达黎加</option>
                                                    <option value="93">瓜德罗普岛</option>
                                                    <option value="147">关岛</option>
                                                    <option value="27">古巴</option>
                                                    <option value="117">圭亚那</option>
                                                    <option value="14">海地</option>
                                                    <option value="171">韩国</option>
                                                    <option value="101">哈萨克斯坦</option>
                                                    <option value="180">荷兰</option>
                                                    <option value="98">洪都拉斯</option>
                                                    <option value="164">加纳</option>
                                                    <option value="173">加拿大</option>
                                                    <option value="60">柬埔寨</option>
                                                    <option value="183">加蓬</option>
                                                    <option value="207">吉布提</option>
                                                    <option value="174">捷克共和国</option>
                                                    <option value="71">吉尔吉斯斯坦</option>
                                                    <option value="44">基里巴斯</option>
                                                    <option value="206">津巴布韦</option>
                                                    <option value="115">几内亚</option>
                                                    <option value="55">几内亚比绍</option>
                                                    <option value="138">开曼群岛</option>
                                                    <option value="130">喀麦隆</option>
                                                    <option value="209">卡塔尔</option>
                                                    <option value="26">科科斯群岛(基灵群岛)</option>
                                                    <option value="200">克罗地亚</option>
                                                    <option value="145">科摩罗联盟</option>
                                                    <option value="50">肯尼亚</option>
                                                    <option value="223">科索沃</option>
                                                    <option value="160">科特迪瓦共和国</option>
                                                    <option value="126">科威特</option>
                                                    <option value="22">库可群岛</option>
                                                    <option value="165">莱索托</option>
                                                    <option value="48">老挝</option>
                                                    <option value="40">拉脱维亚</option>
                                                    <option value="193">黎巴嫩</option>
                                                    <option value="12">利比里亚</option>
                                                    <option value="214">利比亚</option>
                                                    <option value="5">列支敦士登</option>
                                                    <option value="213">立陶宛</option>
                                                    <option value="124">罗马尼亚</option>
                                                    <option value="110">卢森堡</option>
                                                    <option value="175">卢旺达</option>
                                                    <option value="136">马达加斯加</option>
                                                    <option value="68">马尔代夫</option>
                                                    <option value="127">马耳他</option>
                                                    <option value="21">马来西亚</option>
                                                    <option value="23">马拉维</option>
                                                    <option value="139">马里</option>
                                                    <option value="15">毛里求斯</option>
                                                    <option value="121">毛利塔尼亚</option>
                                                    <option value="222">马其顿</option>
                                                    <option value="87">马绍尔群岛</option>
                                                    <option value="197">美国</option>
                                                    <option value="122">美属外岛</option>
                                                    <option value="188">美属维尔京群岛</option>
                                                    <option value="57">蒙古</option>
                                                    <option value="10">孟加拉国</option>
                                                    <option value="4">缅甸</option>
                                                    <option value="97">密克罗尼西亚</option>
                                                    <option value="63">摩尔多瓦</option>
                                                    <option value="179">摩洛哥</option>
                                                    <option value="18">摩纳哥</option>
                                                    <option value="191">莫桑比克</option>
                                                    <option value="116">墨西哥</option>
                                                    <option value="43">纳米比亚</option>
                                                    <option value="194">南非</option>
                                                    <option value="128">南极洲</option>
                                                    <option value="100">南斯拉夫</option>
                                                    <option value="86">瑙鲁</option>
                                                    <option value="210">尼加拉瓜</option>
                                                    <option value="141">尼泊尔</option>
                                                    <option value="8">尼日尔</option>
                                                    <option value="31">尼日利亚</option>
                                                    <option value="85">纽埃</option>
                                                    <option value="119">挪威</option>
                                                    <option value="109">帕劳群岛</option>
                                                    <option value="90">皮特凯恩群岛</option>
                                                    <option value="77">葡萄牙</option>
                                                    <option value="131">日本</option>
                                                    <option value="154">瑞典</option>
                                                    <option value="142">瑞士</option>
                                                    <option value="215">萨尔瓦多</option>
                                                    <option value="221">塞尔维亚</option>
                                                    <option value="83">塞拉利昂</option>
                                                    <option value="74">塞内加尔</option>
                                                    <option value="187">塞浦路斯</option>
                                                    <option value="177">塞舌尔</option>
                                                    <option value="135">萨摩亚</option>
                                                    <option value="75">沙特阿拉伯</option>
                                                    <option value="151">圣诞岛</option>
                                                    <option value="192">圣多美和普林西比</option>
                                                    <option value="148">圣赫勒拿岛</option>
                                                    <option value="169">圣卢西亚</option>
                                                    <option value="80">圣马力诺</option>
                                                    <option value="211">斯里兰卡</option>
                                                    <option value="52">斯洛伐克</option>
                                                    <option value="70">斯洛文尼亚</option>
                                                    <option value="13">斯威士兰</option>
                                                    <option value="212">苏丹</option>
                                                    <option value="72">苏联(前)</option>
                                                    <option value="59">苏里南</option>
                                                    <option value="208">所罗门群岛</option>
                                                    <option value="84">索马里</option>
                                                    <option value="89">泰国</option>
                                                    <option value="54">台湾</option>
                                                    <option value="163">塔吉克斯坦</option>
                                                    <option value="132">汤加</option>
                                                    <option value="218">坦桑尼亚</option>
                                                    <option value="198">特立尼达和多巴哥</option>
                                                    <option value="76">土耳其</option>
                                                    <option value="53">土库曼斯坦</option>
                                                    <option value="28">突尼斯</option>
                                                    <option value="125">托克劳</option>
                                                    <option value="17">图瓦卢</option>
                                                    <option value="205">危地马拉</option>
                                                    <option value="161">维尔京群岛(英属)</option>
                                                    <option value="66">委内瑞拉</option>
                                                    <option value="9">文莱</option>
                                                    <option value="99">乌干达</option>
                                                    <option value="35">乌克兰</option>
                                                    <option value="146">乌拉圭</option>
                                                    <option value="20">乌兹别克斯坦</option>
                                                    <option value="189">香港特别行政区</option>
                                                    <option value="79">西班牙</option>
                                                    <option value="61">希腊</option>
                                                    <option value="201">新加坡</option>
                                                    <option value="155">新喀里多尼亚</option>
                                                    <option value="30">新西兰</option>
                                                    <option value="152">匈牙利</option>
                                                    <option value="143">西撒哈拉</option>
                                                    <option value="6">叙利亚</option>
                                                    <option value="137">牙买加</option>
                                                    <option value="25">亚美尼亚</option>
                                                    <option value="204">也门</option>
                                                    <option value="149">意大利</option>
                                                    <option value="67">伊拉克</option>
                                                    <option value="2">伊朗</option>
                                                    <option value="33">印度</option>
                                                    <option value="112">印度尼西亚</option>
                                                    <option value="123">英国</option>
                                                    <option value="203">英属印度洋领地</option>
                                                    <option value="94">以色列</option>
                                                    <option value="56">约旦</option>
                                                    <option value="104">越南</option>
                                                    <option value="51">赞比亚</option>
                                                    <option value="217">乍得</option>
                                                    <option value="190">扎伊尔</option>
                                                    <option value="113">直布罗陀</option>
                                                    <option value="114">智利</option>
                                                    <option value="96">中非共和国</option>
                                                </select>
                                                <span>语言：</span>
                                                <select class="config-input select2" name="language"
                                                        id="[[ config.id ]]_id_language" tabindex="-1">
                                                    <option value="117">中文、汉语</option>
                                                    <option value="187">中文繁体</option>
                                                    <option value="5">英语</option>
                                                    <option value="87">阿布哈兹语</option>
                                                    <option value="101">阿尔巴尼亚语</option>
                                                    <option value="183">阿法尔语</option>
                                                    <option value="166">爱尔兰语</option>
                                                    <option value="25">艾马拉语</option>
                                                    <option value="79">爱沙尼亚语</option>
                                                    <option value="17">埃维语</option>
                                                    <option value="89">阿坎语</option>
                                                    <option value="121">阿拉伯语</option>
                                                    <option value="58">阿拉贡语</option>
                                                    <option value="95">阿姆哈拉语</option>
                                                    <option value="32">奥吉布瓦语</option>
                                                    <option value="170">奥克语</option>
                                                    <option value="93">奥利亚语</option>
                                                    <option value="97">奥洛莫语</option>
                                                    <option value="159">奥塞梯语</option>
                                                    <option value="135">阿塞拜疆语</option>
                                                    <option value="137">阿萨姆语</option>
                                                    <option value="45">阿瓦尔语</option>
                                                    <option value="116">阿维斯陀语</option>
                                                    <option value="118">白俄罗斯语</option>
                                                    <option value="83">巴利语</option>
                                                    <option value="51">班巴拉语</option>
                                                    <option value="164">保加利亚语</option>
                                                    <option value="65">巴什基尔语</option>
                                                    <option value="3">巴斯克语</option>
                                                    <option value="43">北恩德贝勒语</option>
                                                    <option value="64">北萨米语</option>
                                                    <option value="157">比哈尔语</option>
                                                    <option value="72">冰岛语</option>
                                                    <option value="96">比斯拉马语</option>
                                                    <option value="40">波兰语</option>
                                                    <option value="98">波斯尼亚语</option>
                                                    <option value="9">波斯语</option>
                                                    <option value="77">不丹语</option>
                                                    <option value="63">布列塔尼语</option>
                                                    <option value="186">藏语</option>
                                                    <option value="6">查莫罗语</option>
                                                    <option value="139">朝鲜语、韩语</option>
                                                    <option value="66">车臣语</option>
                                                    <option value="48">楚瓦什语</option>
                                                    <option value="88">丹麦语</option>
                                                    <option value="124">德语</option>
                                                    <option value="56">迪维希语</option>
                                                    <option value="81">恩敦加语</option>
                                                    <option value="115">俄语</option>
                                                    <option value="109">法罗语</option>
                                                    <option value="68">梵语</option>
                                                    <option value="74">法语</option>
                                                    <option value="99">斐济语</option>
                                                    <option value="82">芬兰语</option>
                                                    <option value="146">富拉语</option>
                                                    <option value="172">弗里西亚语</option>
                                                    <option value="75">刚果语</option>
                                                    <option value="138">高棉语</option>
                                                    <option value="128">格陵兰语</option>
                                                    <option value="84">格鲁吉亚语</option>
                                                    <option value="12">瓜拉尼语</option>
                                                    <option value="144">古教会斯拉夫语</option>
                                                    <option value="102">古吉拉特语</option>
                                                    <option value="110">国际语A</option>
                                                    <option value="8">国际语E</option>
                                                    <option value="107">海地克里奥尔语</option>
                                                    <option value="129">豪萨语</option>
                                                    <option value="100">哈萨克语</option>
                                                    <option value="156">荷兰语</option>
                                                    <option value="103">赫雷罗语</option>
                                                    <option value="15">加利西亚语</option>
                                                    <option value="131">加泰隆语</option>
                                                    <option value="76">捷克语</option>
                                                    <option value="176">吉尔吉斯语</option>
                                                    <option value="154">基库尤语</option>
                                                    <option value="22">基隆迪语</option>
                                                    <option value="21">凯楚亚语</option>
                                                    <option value="127">卡纳达语</option>
                                                    <option value="147">康沃尔语</option>
                                                    <option value="24">卡努里语</option>
                                                    <option value="174">克里语</option>
                                                    <option value="60">克罗地亚语</option>
                                                    <option value="61">科米语</option>
                                                    <option value="4">科萨语</option>
                                                    <option value="50">克什米尔语</option>
                                                    <option value="173">科西嘉语</option>
                                                    <option value="158">宽亚玛语</option>
                                                    <option value="54">库尔德语</option>
                                                    <option value="30">拉丁语</option>
                                                    <option value="149">老挝语</option>
                                                    <option value="41">拉脱维亚语</option>
                                                    <option value="113">林堡语</option>
                                                    <option value="10">林加拉语</option>
                                                    <option value="133">立陶宛语</option>
                                                    <option value="38">卢巴语</option>
                                                    <option value="175">卢干达语</option>
                                                    <option value="126">罗马尼亚语</option>
                                                    <option value="151">罗曼什语</option>
                                                    <option value="141">卢森堡语</option>
                                                    <option value="31">卢旺达语</option>
                                                    <option value="26">马达加斯加语</option>
                                                    <option value="161">马恩岛语</option>
                                                    <option value="69">马耳他语</option>
                                                    <option value="163">马来语</option>
                                                    <option value="106">马拉提语</option>
                                                    <option value="7">马拉亚拉姆语</option>
                                                    <option value="153">毛利语</option>
                                                    <option value="182">马其顿语</option>
                                                    <option value="119">马绍尔语</option>
                                                    <option value="112">蒙古语</option>
                                                    <option value="162">孟加拉语</option>
                                                    <option value="18">缅甸语</option>
                                                    <option value="177">摩尔达维亚语</option>
                                                    <option value="29">南恩德贝勒语</option>
                                                    <option value="105">南非语</option>
                                                    <option value="20">南索托语</option>
                                                    <option value="2">瑙鲁语</option>
                                                    <option value="143">纳瓦霍语</option>
                                                    <option value="130">尼泊尔语</option>
                                                    <option value="181">尼扬贾语</option>
                                                    <option value="171">挪威语</option>
                                                    <option value="178">旁遮普语</option>
                                                    <option value="90">普什图语</option>
                                                    <option value="23">葡萄牙语</option>
                                                    <option value="39">日语</option>
                                                    <option value="47">瑞典语</option>
                                                    <option value="42">萨丁尼亚语</option>
                                                    <option value="169">塞茨瓦纳语</option>
                                                    <option value="160">塞尔维亚-克罗地亚语</option>
                                                    <option value="46">塞尔维亚语</option>
                                                    <option value="145">萨摩亚语</option>
                                                    <option value="94">桑戈语</option>
                                                    <option value="85">僧加罗语</option>
                                                    <option value="35">绍纳语</option>
                                                    <option value="86">世界语</option>
                                                    <option value="122">书面挪威语</option>
                                                    <option value="132">四川彝语（诺苏语）</option>
                                                    <option value="108">斯洛伐克语</option>
                                                    <option value="67">斯洛文尼亚语</option>
                                                    <option value="57">斯瓦特语</option>
                                                    <option value="134">斯瓦希里语</option>
                                                    <option value="91">苏格兰盖尔语</option>
                                                    <option value="36">索马里语</option>
                                                    <option value="150">泰卢固语</option>
                                                    <option value="185">泰米尔语</option>
                                                    <option value="140">泰语</option>
                                                    <option value="33">菲律宾语</option>
                                                    <option value="78">塔吉克语</option>
                                                    <option value="80">汤加语</option>
                                                    <option value="92">塔塔尔语</option>
                                                    <option value="55">塔希提语</option>
                                                    <option value="19">特威语</option>
                                                    <option value="53">提格里尼亚语</option>
                                                    <option value="168">土耳其语</option>
                                                    <option value="52">土库曼语</option>
                                                    <option value="1">威尔士语</option>
                                                    <option value="136">维吾尔语</option>
                                                    <option value="184">文达语</option>
                                                    <option value="13">沃拉普克语</option>
                                                    <option value="179">沃伦语</option>
                                                    <option value="44">沃洛夫语</option>
                                                    <option value="62">乌尔都语</option>
                                                    <option value="180">乌克兰语</option>
                                                    <option value="28">乌兹别克语</option>
                                                    <option value="125">现代希腊语</option>
                                                    <option value="73">西班牙语</option>
                                                    <option value="104">希伯来语</option>
                                                    <option value="167">希里莫图语</option>
                                                    <option value="70">信德语</option>
                                                    <option value="37">新挪威语</option>
                                                    <option value="114">匈牙利语</option>
                                                    <option value="155">巽他语</option>
                                                    <option value="71">亚美尼亚语</option>
                                                    <option value="120">伊博语</option>
                                                    <option value="165">意大利语</option>
                                                    <option value="16">依地语</option>
                                                    <option value="11">伊多语</option>
                                                    <option value="111">印地语</option>
                                                    <option value="34">因纽特语</option>
                                                    <option value="142">印尼语</option>
                                                    <option value="123">依努庇克语</option>
                                                    <option value="59">约鲁巴语</option>
                                                    <option value="152">越南语</option>
                                                    <option value="49">爪哇语</option>
                                                    <option value="14">壮语</option>
                                                    <option value="27">宗加语</option>
                                                    <option value="148">祖鲁语</option>
                                                </select>
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                                </button>
                                                <button type="button" class="btn btn-primary" data-dismiss="modal"
                                                        onclick="synchronization([[ config.id ]]);">
                                                    确定同步
                                                </button>
                                                <button type="button" class="btn btn-primary" data-dismiss="modal"
                                                        onclick="SynPass([[ config.id ]], {{ task.id }});">
                                                    同步并合格
                                                </button>
                                            </div>
                                        </form>
                                        <div class="overlay" style="display: none;">
                                            <i class="fa fa-refresh fa-spin"></i>
                                        </div>
                                    </div><!-- /.modal-content -->
                                </div><!-- /.modal -->
                            </div>
                            <!-- 模态框（Modal） -->
                        </template>
                    </template>
                </div>
                <div>
                    {% if task.status.code == 1 %}
                        <p class="btn btn-primary" onclick="allocate({{ task.id }})">分配任务</p>
                    {% elif task.status.code == 2 and user.is_superuser %}
                        <p class="btn btn-primary" onclick="retrieve({{ task.id }},false)">回收任务</p>
                        <p class="btn btn-primary" onclick="retrieve({{ task.id }},true)">回收并添加新任务</p>
                    {% elif task.status.code == 3 %}
                        {% if user.is_superuser or user.is_agent %}
                            <p class="btn btn-primary" onclick="pass({{ task.id }})">批准通过</p>
                            <!--<p class="btn btn-primary" onclick="reject({{ task.id }})">驳回申请</p>-->
                            <p class="btn btn-primary" onclick="operation({{ task.id }})">驳回申请</p>
                            {% if task.disqualify_reason_new %}
                                <div style="margin-top:20px;">
                                    <b>不合格原因:{{ task.disqualify_reason_new }} 补充描述:{{ task.disqualify_reason }}</b><a
                                        target="_blank"
                                        href="http://wpa.qq.com/msgrd?v=3&uin={{ qq }}&site=qq&menu=yes"><img border="0"
                                                                                                              src="http://wpa.qq.com/pa?p=2:{{ qq }}:51"
                                                                                                              alt="点击这里给我发消息"
                                                                                                              title="点击这里给我发消息"/></a>
                                </div>
                            {% else %}
                                <b>不合格原因:{{ task.unfeedback }}</b>
                            {% endif %}
                        {% endif %}
                    {% elif task.status.code == 4 %}
                        {% if user.is_superuser or user.is_agent %}
                            <p class="btn btn-primary" onclick="revoke({{ task.id }})">改判为不合格</p>
                            <p class="btn btn-primary" onclick="adoptone({{ task.id }})">通过</p>
                        {% endif %}
                    {% elif task.status.code == 5 and qq %}
                        {% if user.is_superuser or user.is_agent %}
                            <p class="btn btn-primary" onclick="check({{ task.id }})">改判为合格</p>
                        {% elif user.is_superuser %}
                            <p class="btn btn-primary" onclick="retrieve({{ task.id }},false)">回收任务</p>
                            <p class="btn btn-primary" onclick="retrieve({{ task.id }},true)">回收并添加新任务</p>
                        {% endif %}
                        <div style="margin-top:20px;">
                            {% if disqualify_reason_new %}
                                <b>不合格原因:{{ disqualify_reason_new }}
                                    补充描述:{{ task.disqualify_reason }}</b>&nbsp&nbsp<b>审核人:{{ username }}</b>
                                <a target="_blank"
                                   href="http://wpa.qq.com/msgrd?v=3&uin={{ qq }}&site=qq&menu=yes"><img
                                        border="0" src="http://wpa.qq.com/pa?p=2:{{ qq }}:51" alt="点击这里给我发消息"
                                        title="点击这里给我发消息"/></a>
                            {% else %}
                                <b>不合格原因:{{ task.unfeedback }}</b>
                            {% endif %}
                        </div>
                    {% elif task.status.code == 5 and qq == None %}
                        {% if user.is_superuser or user.is_agent %}
                            <p class="btn btn-primary" onclick="check({{ task.id }})">改判为合格</p>
                        {% elif user.is_superuser %}
                            <p class="btn btn-primary" onclick="retrieve({{ task.id }},false)">回收任务</p>
                            <p class="btn btn-primary" onclick="retrieve({{ task.id }},true)">回收并添加新任务</p>
                        {% endif %}
                        <div style="margin-top:20px;">
                            {% if disqualify_reason_new %}
                                <b>不合格原因:{{ task.disqualify_reason_new }} 补充描述:{{ task.disqualify_reason }}</b>
                            {% else %}
                                <b>不合格原因:{{ task.unfeedback }}</b>
                            {% endif %}

                        </div>
                    {% endif %}
                </div>

                <br>
            </div>
        </div>
    </div>

    <!--  审核记录   -->
    <div class="row">
        <div class="col-md-6">
            <!-- DIRECT CHAT -->
            <div class="box box-primary direct-chat direct-chat-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">审核记录</h3>
                    <div class="box-tools pull-right">
                        <span data-toggle="tooltip" title="{{ communicatesNum }} Messages"
                              class="badge bg-blue">{{ communicatesNum }}</span>
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i
                                class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <div class="box-body">
                    <table id="auditRecordTable" border="1" class="table table-bordered table-hover table-striped">
                        <thead>
                        <tr>
                            <th class="action-checkbox">
                                    <span style="float: left">
                                        审核时间
                                    </span>
                            </th>
                            <th>
                                    <span style="float: left">
                                        变更前
                                    </span>
                            </th>
                            <th>
                                    <span style="float: left">
                                        变更后
                                    </span>
                            </th>
                            <th style="width: 350px;">
                                    <span style="float: left">
                                        不合格原因
                                    </span>
                            </th>
                            <th>
                                    <span style="float: left">
                                        审核人员
                                    </span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-if="auditRecord == '' ">
                            <td>暂无记录</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <template v-for="record in auditRecord">
                            <tr>
                                <td>
                                    <span>[[ parseTime(record.changed_flag) ]]</span>
                                </td>
                                <td>
                                    <span>[[ record.changed_before ]]</span>
                                </td>
                                <td>
                                    <span>[[ record.changed_after ]]</span>
                                </td>
                                <td>
                                    <span>[[ record.unfeedback ]]</span>
                                </td>
                                <td>
                                    <span>[[ record.auditor ]]</span>
                                </td>
                            </tr>
                        </template>
                        </tbody>
                    </table>
                </div>

                <div class="box-footer">
                    <div class="input-group">
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--弹出任务通过提示消息-->
    <div class="modal fade" id="adopt" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" style="top:40%">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div id="msgBoxMsg" class="modal-body" style="overflow:auto;text-align:center;">
                    确定要通过吗?
                </div>
                <div class="modal-footer" style="text-align:center;">
                    <button type="button" class="btn btn-default" onclick="adopt()"
                            data-dismiss="modal">确认
                    </button>
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">取消
                    </button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="userList" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" style="top:30%">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-body" style="overflow:auto">
                    <label>请选择要分配给谁（可以多选）：</label>
                    <!--
                    {/% for user in configUsers %}
                        <br><input name="user" type="radio" value="{/{ user.id }}">
                        <label>{/{ user.user.username }}</label>
                    {/% endfor %}
                    -->
                    <table id="user_each_table" border="1" class="table table-bordered table-hover table-striped">
                        <thead>
                        <tr>
                            <th class="action-checkbox">
                                <input type="checkbox" name="uth_checkbox" onclick="_checkAll(this)">
                            </th>
                            <th>
                                    <span style="float: left">
                                        用户名
                                    </span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for user in configUsers %}
                            <br>
                            <tr>
                                <td class="action-checkbox">
                                    <input type="checkbox" name="utd_checkbox" value="{{ user.user.id }}"
                                           onclick="_checkOne(this)">
                                </td>
                                <td>{{ user.user.username }}</td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" id="confirm_close" class="btn btn-default"
                            data-dismiss="modal" onclick="confirmClose()">确认
                    </button>
                    <button type="button" id="cancel_close" class="btn btn-default"
                            data-dismiss="modal" onclick="cancelClose()">取消
                    </button>
                </div>
            </div>
        </div>
    </div>


    <!--弹出没有选择用户的提示消息-->
    <div class="modal fade" id="userMessage" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" style="top:40%">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div id="msgBoxMsg" class="modal-body" style="overflow:auto;text-align:center;">
                    请至少选择一个用户！
                </div>
                <div class="modal-footer" style="text-align:center;">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">确认
                    </button>
                </div>
            </div>
        </div>
    </div>
    <!--确认删除配置弹出框-->
    <div class="modal fade" id="delete-config-window" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" style="top:30%">
        <div class="modal-dialog" role="document">
            <div class="panel panel-danger">
                <div class="panel-heading">
                    <h3 class="panel-title">确认要删除配置吗？</h3>
                </div>
                <div class="modal-footer">
                    <button type="button" id="cancel_delete" class="btn btn-default"
                            data-dismiss="modal">取消
                    </button>
                    <button id="submit-delete" class="btn btn-default" onclick="deleteConfigs()">
                        确定
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!--弹出操作提示消息-->
    <div class="modal fade" id="operationMessage" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" style="top:40%">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header" style="background-color: #307095;font-weight: bold;">
                    <label>请填写不合格原因：</label>
                </div>

                <div id="msgBoxMsg" class="modal-body" style="overflow:auto;text-align:center;">

                    <input style="width:400px;height:100px;" type="text" id="fankui" name="fankuiyy"/>

                </div>
                <div class="modal-footer" style="text-align:center;">
                    <button type="button" class="btn btn-default" onclick="_revoke()"
                            data-dismiss="modal">确认
                    </button>

                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">取消
                    </button>
                </div>
            </div>
        </div>
    </div>

    <input id="taskIds" value="" style="display:none;"></input>
    <script>
        Vue.config.delimiters = ["[[", "]]"];

        function detailOneConfig(cid) {
            var url = "{% url 'task:detail' %}" + "?id=" + cid + "&type=config";
            window.location.href = url;
        }

        function toPage(response, page, url) {
            var sec = 2000;
            var message = response.message;
            var result = response.result;
            var $message = $("#message");
            if (message) {
                $message.text(message);
            }
            setTimeout(function () {
                console.log(url);
                if (url) {
                    window.location.href = url;
                } else {
                    if (page == -1) {
                        window.location.href = document.referrer;
                    } else if (page == 0) {
                        window.location.reload();
                        $message.text("");
                    } else {
                        if (result == true) {
                            window.location.href = "";
                        } else {
                            $message.text("");
                        }
                    }
                }
            }, sec);
        }

        function check(tids) {
            $.ajaxSetup({
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}',
                    tids: tids
                }
            });
            $.post(
                "{% url 'task:check' %}",
                function (response) {
                    toPage(response, 0);
                }
            )
        }

        function _revoke() {
            var tids = $("#taskIds").val();
            var fankui = $("#fankui").val();
            $.ajaxSetup({
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}',
                    tids: tids,
                    fankui: fankui
                }
            });
            $.post(
                "{% url 'task:revoke' %}",
                function (response) {
                    toPage(response, 0);
                    clearCheckAll();
                }
            )
        }

        function revoke(tid) {
            if (tid) {
                $("#taskIds").val(tid);
                $("#operationMessage").modal();
            } else {
                return false
            }
        }

        var _cids;

        function deleteOneConfig(cid) {
            //$("#configIds").val(cid);
            _cids = cid;
            $("#delete-config-window").modal();
        }

        function deleteConfigs(cids) {
            if (!cids) {
                cids = _cids
            }
            if (!cids) {
                alert("请给出要删除的配置ID！")
            } else {
                $.ajaxSetup({
                    data: {
                        csrfmiddlewaretoken: '{{ csrf_token }}',
                        cids: cids
                    }
                });
                $.post(
                    "{% url 'task:delete_config' %}",
                    function (response) {
                        alert(response.message);
                        window.location.href = document.referrer;
                        _cids = null;
                    }
                )
            }
        }

        function retrieve(tids, addNewOne) {
            if (!tids) {
                return false
            }
            if (tids.length === 0) {
                return false
            } else {
                $.ajaxSetup({
                    data: {
                        csrfmiddlewaretoken: '{{ csrf_token }}',
                        tids: tids,
                        addNewOne: addNewOne
                    }
                });
                $.post(
                    "{% url 'task:retrieve' %}",
                    function (response) {
                        toPage(response, -1)
                    }
                )
            }
        }

        function operation(tids) {
            if (tids) {
                tids = tids + "";
                $("#taskIds").val(tids);
                $("#operationMessage").modal();
            } else {
                return false
            }
        }


        function reject(tids, cvalue) {
            var tid = tids;
            var cvalue = cvalue;
            $.ajaxSetup({
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}',
                    tids: tids,
                    cvalue: cvalue,
                }
            });
            $.post(
                "{% url 'task:reject' %}",
                function (response) {
                    //console.log(response);
                    toPage(response, -1);
                }
            )
        }

        function pass() {
            var tid = {{ task.id }};
            $.ajaxSetup({
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}',
                    tids: tid
                }
            });
            $.post(
                "{% url 'task:pass' %}",
                function (response) {
                    //console.log(response);
                    toPage(response, -1)
                }
            )
        }

        function confirmCloses() {
            var tids = $("#taskIds").val();
            var fankui = $("#fankui").val();
            var uid = {{ user_id|safe }};
            var cvalue = fankui + "#" + uid

            if (tids.length === 0) {
                $("#taskMessage").modal();
                return false;
            }
            if (cvalue === '') {
                $("#taskMessage").modal();
                return false
            } else {
                reject(tids, cvalue)
            }


        }


        function confirmClose() {
            var tids = $("#taskIds").val();
            var userIds = [];
            $("input[name='utd_checkbox']:checked").each(
                function () {
                    userIds.push($(this).val());
                }
            );
            if (tids.length === 0) {
                $("#taskMessage").modal();
                return false;
            }
            uids = userIds.join();
            if (uids.length === 0) {
                $("#userMessage").modal();
                return false
            }
            _allocate(tids, uids);
            _clearChecked();
        }

        function cancelClose() {
            _clearChecked();
        }

        function _clearChecked() {
            if ($("input[name='uth_checkbox']").is(":checked")) {
                $("input[name='uth_checkbox']").prop("checked", false)
            }
            $("input[name='utd_checkbox']:checked").each(
                function () {
                    $(this).prop("checked", false);
                }
            );
        }

        function showUsers() {
            var userBox = $("#userList");
            userBox.modal()
        }

        function allocate(tids) {
            if (tids.length === 0) {
                return false
            } else {
                $("#taskIds").val(tids);
                showUsers();
            }
        }

        function _allocate(tids, uids) {
            if (!tids) {
                tids = $("#taskIds").val();
            }
            if (!uids) {
                var _uids = [];
                $("input[name='utd_checkbox']:checked").each(
                    function () {
                        _uids.push($(this).val())
                    }
                );
                uids = _uids.join();
            }
            if (uids.length === 0) {
                return false
            }
            if (tids.length === 0) {
                console.log(tids, uids);
                $("#taskMessage").modal();
                return false
            } else {
                $.ajaxSetup({
                    data: {
                        csrfmiddlewaretoken: '{{ csrf_token }}',
                        tids: tids,
                        uids: uids
                    }
                });
                $.post(
                    "{% url 'task:allocate' %}",
                    function (response) {
                        var msg = response.message;
                        console.log(msg);
                        if (msg) {
                            alert(msg);
                        }
                        toPage('current')
                    }
                )
            }
            $("#taskIds").val("");
        }

        var configListVue = new Vue({
            el: "#configList",
            data: {
                headers: [],
                configs: [],
                message: ""
            },
            methods: {
                parseTime: function (timeStamp) {
                    if (!timeStamp) {
                        return ""
                    }
                    var newDate = new Date();
                    newDate.setTime(timeStamp * 1000);
                    return newDate.toLocaleDateString()
                }
            }
        });

        function _checkAll(obj) {
            if ($(obj).is(":checked")) {
                $("input[name='utd_checkbox']").prop("checked", true)
            } else {
                $("input[name='utd_checkbox']").prop("checked", false)
            }

        }

        function _checkOne(obj) {
            if ($("input[name='uth_checkbox']").is(":checked")) {
                $("input[name='uth_checkbox']").prop("checked", false)
            } else {
                var unChecked = 0;
                $("input[name='utd_checkbox']").each(
                    function () {
                        if ($(this).is(":checked")) {

                        } else {
                            unChecked += 1
                        }
                    }
                );
                if (unChecked === 0) {
                    $("input[name='uth_checkbox']").prop("checked", true)
                }
            }
        }

        function getConfigs(obj) {
            var formData = "tid={{ task.id }}";
            $.get(
                "{% url 'task:get_configs' %}",
                formData,
                function (response) {
                    if (response) {
                        obj.headers = response.headers;
                        obj.configs = response.configs;
                        obj.message = response.message;
                        //console.log(obj.configs)
                    } else {
                        obj.message = "无法获取到配置信息。";
                    }
                }
            )
        }

        getConfigs(configListVue);
        $("#taskManager").addClass("active");


        //    一键同步
        function synchronization(cid) {
            var gid = $("#" + cid + "_conf_group  option:selected").val();
            var webtype = $("#" + cid + "_web_type option:selected").val();
            var tid = $("#" + cid + "_trade_type option:selected").val();
            //去重库
            var uig = $("#" + cid + "_id_uig option:selected").val();
            //是否代理
            var is_agent = $("#" + cid + "_id_is_agent option:selected").val();
            //代理地址
            var proxy_addresses_id = $("#" + cid + "_id_proxy_addresses_id option:selected").val();
            //数据来源
            var datasourcetype = $("#" + cid + "_id_datasourcetype option:selected").val();
            //国家
            var country = $("#" + cid + "_id_country option:selected").val();
            //语言
            var language = $("#" + cid + "_id_language option:selected").val();
            //文件名
            var file_name = $("#" + cid + "_file_name").val();
            //网站名称
            var webname = $("#" + cid + "_webname").val();
            //标签
            var tags = $("#" + cid + "_id_tag").val();
            //域名
            var domain = $("#" + cid + "_domain").val();
            //路径
            var path = $("#" + cid + "_path").val();
            // 主体类型
            var yqms_main_type_id = $('#id_yqms_main_type_id').val();
            // 网站来源
            var yqms_web_source_id = $('#id_yqms_web_source_id').val();

            if (gid && webtype && tid && datasourcetype && tags) {
                $('.overlay').show();
                $.post({
                    data: {
                        conf_gid: gid,
                        webtype: webtype,
                        conf_tid: tid,
                        uig: uig,
                        agent: is_agent,
                        proxy_id: proxy_addresses_id,
                        datasourcetype: datasourcetype,
                        country: country,
                        language: language,
                        file_name: file_name,
                        webname: webname,
                        tags: tags,
                        domain: domain,
                        path: path,
                        yqms_main_type_id: yqms_main_type_id,
                        yqms_web_source_id: yqms_web_source_id,
                        csrfmiddlewaretoken: '{{ csrf_token }}',
                        auditor: '{{ user }}',
                        icp: '{{ task.icp }}',
                        pass_time: new Date().getTime()
                    },
                    url: "{% url 'task:eligibleConfigRedis' %}",
                    success: function (response) {
                        alert(response.message);
                        $('.overlay').hide();
                        $('#myModal').fadeOut();
                        $('.modal-backdrop').fadeOut();
                    }, error: function (response) {
                        alert(response.message);
                        $('.overlay').hide();
                        $('#myModal').fadeOut();
                        $('.modal-backdrop').fadeOut();
                    }
                });
            } else {
                alert('配置信息不能为空')
            }
        }

        function adoptone(tids) {
            if (tids) {
                tids = tids + "";
                $("#taskIds").val(tids);
                $("#adopt").modal();
            } else {
                return false
            }
        }

        function _adopt(tids) {
            if (!tids) {
                var _tids = [];
                $("input[name='td_checkbox']:checked").each(
                    function () {
                        _tids.push($(this).val())
                    }
                );
                tids = _tids.join();
            }
            if (tids.length === 0) {
                $("#taskMessage").modal();
                return false
            } else {
                $("#taskIds").val(tids);
                $("#adopt").modal()
            }
        }

        function adopt(tids) {
            if (!tids) {
                tids = $("#taskIds").val();
            }
            if (tids.length === 0) {
                $("#taskMessage").modal();
                return false
            } else {
                __adopt(tids)
            }
            $("#taskIds").val("")
        }

        function __adopt(tids) {
            $.ajaxSetup({
                data: {
                    csrfmiddlewaretoken: '{{ csrf_token }}',
                    tids: tids,
                }
            });
            $.post(
                "{% url 'task:adopt' %}",
                function (response) {
                    var msg = response.message;
                    if (msg) {
                        alert(msg);
                    }
                    toPage("current");
                    window.location.href = window.location.href
                }
            )
        }

        var auditRecordVue = new Vue({
            el: "#auditRecordTable",
            data: {
                searchForm: "",
                auditRecord: {},
            },
            methods: {
                parseTime: function (timeStamp) {
                    if (!timeStamp) {
                        return ""
                    }
                    var newDate = new Date();
                    newDate.setTime(timeStamp * 1000);
                    return newDate.toLocaleDateString()
                },
            }
        });

        // 审核记录
        function auditRecord() {
            var searchForm = 'tid=' + '{{ task.id }}';
            $.get(
                "{% url 'task:task_audit_record_detail' %}",
                searchForm,
                function (response) {
                    if (response) {
                        console.log(response.data);
                        auditRecordVue.auditRecord = response.data;
                    }
                }
            );
        };

        auditRecord()

    </script>
{% endblock section_content %}